package exam.jingdong.S1;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        sc.nextLine();
        String s = sc.nextLine();

        char c = ' ';
        for (int i=0; i<s.length(); ++i) {
            c = s.charAt(i);
            if (i < k) {
                if (c >= 'A' && c <= 'Z')
                    System.out.print(c);
                else
                    System.out.print((char) (c - 'a' + 'A'));
            } else {
                if (c >= 'A' && c <= 'Z')
                    System.out.print((char) (c - 'A' + 'a'));
                else
                    System.out.print(c);
            }
        }
        System.out.println();
    }
}
